<template>
  <div>
    <div class="header">
      <div @click="fanhui">
        <van-icon name="arrow-left" />
      </div>
      <div>
        <van-search
          v-model="value"
          shape="round"
          placeholder="请输入关键词"
        />
      </div>
      <div @click="search">搜索</div>
    </div>
    <div class="content">
      <p style="font-size: 14px; color:#999;">猜你想搜</p>
      <div class="context">
        <div v-for="item in list" :key="item.id">
          <van-text-ellipsis :content="item.text" />
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from "vue";
import axios from "axios"
let list = ref([
  { id: 1, text: "按外科粉嫩发给威风威风我恶妇" },
  { id: 2, text: "按外科粉嫩发我恶妇" },
  { id: 3, text: "按外科粉嫩发我恶妇" },
  { id: 4, text: "过任务" },
]);
let value = ref("");
const fanhui = () => {
  history.back();
};
let form = ref({
    name:""
})
const search = async() => {
    let data = await axios.post("http://localhost:3000/video_search",form.value)
    console.log(data);
};
</script>

<style lang="less" scoped>
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  height: 50px;
}
.van-search {
  width: 300px;
}
.content {
  margin: auto;
  width: 95%;
}
.context {
  margin: auto;
  width: 95%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  div {
    margin-top: 10px;
  }
}
</style>
